package swingOutput;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JPanel;

import map.Map;

public class MainPanel extends JPanel {
	private FieldPanel _fPanel;
	private InfoPanel _iPanel;
	
	public MainPanel(Map map) {
		setLayout(new GridBagLayout());
		GridBagConstraints c = new GridBagConstraints();
		
		c.weightx = 0.5;
		c.weighty = 0.5;
		
		_fPanel = new FieldPanel(map);
		c.ipadx = 629;
		c.ipady = 678;
		c.gridx = 0;
		c.gridy = 0;
		add(_fPanel, c);
		
		_iPanel = new InfoPanel();
		c.ipadx = 0;
		c.ipady = 0;
		c.gridx = 1;
		c.gridy = 0;
		add(_iPanel, c);
	}
	
	public void repaintFrame(){
		_fPanel.repaintFrame();
	}
	
	public void stopRepainting() {
		_fPanel.stopRepainting();
	}
}
